package com.shop.util;

import com.shop.entity.AdminUser;

import javax.servlet.http.HttpServletRequest;

/**
 * description: 该文件说明
 *
 * @author zhaoxiaozhao（xiaozhao.zhao@ucarinc.com）
 * @version 1.0
 * @date 2018/10/16 16:03
 **/
public class SessionUtil {

    public static void setAdminUser(HttpServletRequest request, AdminUser adminUser){
        request.getSession().setAttribute("adminUser",adminUser);
    }
    public static AdminUser getAdminUser(HttpServletRequest request){
        return  (AdminUser)request.getSession().getAttribute("adminUser");
    }
    public static Boolean checkLogin(HttpServletRequest request){
        AdminUser adminUser = getAdminUser( request);
        if(null == adminUser){
          return false;
        }
        return true;
    }
}
